<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<input type="hidden" name="name" id="name" >
	<input type="hidden" name="val" id="val" >
	<div class="popup-frame">
		<div class="popup-header">
			<div class="pull-left">
				<h1>发布菜单</h1>
			</div>
			<div class="pull-right">
				<a id="btn_save" class="btn" >确定</a>
				<a id="btn_close" class="btn btn-return">关闭</a>
			</div>
		</div>
		<div class="popup-body">
			<div class="popup-body-scroll">
				<div class="popup-content">
					<form id="form_data" name="form_data" method="post">
						<div class="operate-panel-body">
							<div class="box">
								<b>发布到微信企业号应用：</b>
								<select name="eq_pid" id="eq_pid" class="input" onchange="submit_search();">
									{:fill_option($agent_list)}
								</select>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var $ = layui.jquery;
			
			var layer = layui.layer;

			//保存后关闭
			$('#btn_save').on('click', function() {
				send_form('form_data', '{:url("weixin_update")}', '', function(ret) {
					if (ret.status == 1) {
						parent.layer.msg(ret.info);
						parent.layer.close(index);
						parent.location.reload(true);
					} else {
						parent.layer.msg(ret.info);
						return false;
					}
				});
			});

			//关闭iframe
			$('#btn_close').click(function() {
				parent.layer.close(index);
			});

		});

	</script>

</block>
